#ifndef BINFILE_H
#define BINFILE_H

#include <QMainWindow>
#include <QObject>
#include "ui_mainwindow.h"
#include <QByteArray>

class BinFile : public QMainWindow
{
    Q_OBJECT
public:
    explicit BinFile(Ui::MainWindow *pui, QWidget *parent = nullptr);
    ~BinFile();

    static quint32& getAppVer();
    static QByteArray& getOperatorMsg();
    static quint32& getRdFileLen();
    static QByteArray getBinFileMid(qsizetype index, qsizetype len = -1);
    static QByteArray& getFileArr();

signals:

private slots:
    void onBtnFilenameSelClicked();

private:
    Ui::MainWindow *ui;

    QString m_filename;
    qsizetype m_fileLen;

    static QByteArray m_fileArr;
    static quint32 m_appVer; // 软件版本
    static QByteArray m_operatorMsg;  // 操作员信息
    static quint32 m_rdFileLen; // 读出来的文件长度

    void getUpdateMessage();
};

#endif // BINFILE_H
